﻿@model ExamPlat.ViewModels.ViewExamQues
@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>考试平台</title>
</head>
<body>
    <div style="width:1000px; margin:0 auto;">
        <div style="text-align:center;"><h2>@Model.ExamQuesTitle</h2></div>
        <div style="text-align:right; padding-right:200px;"><span>考试时长：@Model.ExamQuesTime (分钟)</span>&nbsp;&nbsp;&nbsp;<span>总分：@Model.TotalScore</span></div>
        @{
            int examNum = 0;
            var examQuesItemRepository = new ExamPlat.Repositories.ExamQuesItemRepository();
            int num = 0;
            if (Model.SingleCount != 0)
            {
                examNum++;
                <div>一、单选题（每题 @Model.SingleScore 分， 共 @Model.SingleCount 题）</div>
                IList<ExamPlat.ViewModels.ViewExamQuesItem> singleItems = examQuesItemRepository.GetExamQuesItemByCondition(Model.ID, "", 1);
                <div style="text-indent:2em;">
                    @foreach (var item in singleItems)
                    {
                        num++;
                        <p>@num 、@item.ExamQuesItemTitle <span style="color:red;">(@item.ExamQuesItemAnswer)</span></p>
                        foreach (var item2 in item.OptionList)
                        {
                            var tmpName = "radio" + num;
                            <p style="text-indent:4em;"><input type="radio" name="@tmpName" />@item2.ExamQuesItemOptionNum ： @item2.ExamQuesItemOptionTitle</p>
                        }
                    }
                </div>
            }
            if (Model.MultipleCount != 0)
            {
                var examFlag = "一、";
                if (examNum == 1)
                {
                    examFlag = "二、";
                }
                examNum++;
                <div>@{@examFlag} 多选题（每题 @Model.MultipleScore 分， 共 @Model.MultipleCount 题）</div>
    IList<ExamPlat.ViewModels.ViewExamQuesItem> multipleItems = examQuesItemRepository.GetExamQuesItemByCondition(Model.ID, "", 2);
    <div style="text-indent:2em;">
        @foreach (var item in multipleItems)
        {
            num++;
            <p>@num 、@item.ExamQuesItemTitle <span style="color:red;">(@item.ExamQuesItemAnswer)</span></p>
            foreach (var item2 in item.OptionList)
            {
                <p style="text-indent:4em;"><input type="checkbox" />@item2.ExamQuesItemOptionNum ： @item2.ExamQuesItemOptionTitle</p>
            }
        }
    </div>
    }
    if (Model.JudgeCount != 0)
    {
        var examFlag = "一、";
        if (examNum == 1)
        {
            examFlag = "二、";
        }
        else if (examNum == 2)
        {
            examFlag = "三、";
        }
        examNum++;
        <div>@{@examFlag} 对错题（每题 @Model.JudgeScore 分， 共 @Model.JudgeCount 题）</div>
        IList<ExamPlat.ViewModels.ViewExamQuesItem> judgeItems = examQuesItemRepository.GetExamQuesItemByCondition(Model.ID, "", 3);
        <div style="text-indent:2em;">
            @foreach (var item in judgeItems)
            {
                num++;
                <p>@num 、@item.ExamQuesItemTitle <span style="color:red;">(@item.ExamQuesItemAnswer)</span></p>
                foreach (var item2 in item.OptionList)
                {
                    <p style="text-indent:4em;"><input type="checkbox" />@item2.ExamQuesItemOptionNum ： @item2.ExamQuesItemOptionTitle</p>
                }
            }
        </div>
    }
        }
    </div>
</body>
</html>
